import Vue from "vue";

// 语音播放函数
export function voicePlay(val,type) {
    // 创建内部音频上下文实例
 const innerAudioContext = uni.createInnerAudioContext();
            innerAudioContext.src = 'http://dict.youdao.com/dictvoice?type='+type+'&audio='+val;
            innerAudioContext.play();
            innerAudioContext.onError((res) => {
                console.log('音频播放出错:', res.errMsg);
            });
}

// 导出默认对象
export default {
    voicePlay
};